/*
 * @Description:经典继承
 * @Author: rendc
 * @Date: 2021-09-03 14:51:52
 * @LastEditors: rendc
 * @LastEditTime: 2021-09-03 15:37:51
 */
function Animal (name) {
  this.name = name;
  this.colors = ['red', 'pink']
  this.sayColor = function () {
    console.log(this.colors);
  };
}
function Dog (name) {
  // 继承animal
  Animal.call(this, name);
  this.color = "hotpink";
}
Animal.prototype.sayName = function () {
  console.log(this.name);
}

var dog = new Dog('铃铛');
console.log(dog);
dog.sayColor();
// dog.sayName(); // 报错